home *** CD-ROM | disk | FTP | other *** search
- >SWIs
-
- This document describes GreyEdit 1.10 (19 Jun 1991)
-
- ----------------------
- - The GreyEdit SWI's -
- ----------------------
- The GreyEdit module contains several SWI's, which are used by the main program,
- !RunImage.
-
- Because some may be useful in other programs, most of the SWI's contained in
- this module are discussed in detail below. They are divided into two groups.
-
- The image processing SWI's may be useful to any kind of user.
-
- The digitiser SWI's may be useful to users that wish to make their own
- digitizing applications using the Zeridajh Video Digitiser.
-
-
- - The image processing SWI's
-
- These SWI's all process or perform computations on an entire image.
-
- Images consist of byte-values, i.e. 0(black)-255(white), that represent the
- pixels' greyvalues.
-
- All image-processing SWI's expect a pointer to an image info block in r0. This
- block contains information about the image to be acted upon :
-
- Offset Name Meaning
- ------ ---- -------------------------------
- 0 start pointer to start of image data
- 4 xpix horizontal resolution in pixels
- 8 ypix vertical resolution in pixels
- 12 xskip pixels to skip at end of rows
-
- The xskip value enables the image to be actually stored as a sprite. For
- example, if start=&20000, xpix=637, ypix=512, and xskip=3, then the image has
- the following structure :
-
- &20000 : <637 bytes of image data> <3 bytes alignment, ignored>, i.e. row 1
- &20280 : "" "" , i.e. row 2
- &20500 : "" "" , i.e. row 3
- .....
- &6FD80 : "" "" , i.e. row 512
-
- Thus, dis-alignment within the sprite presents no problems, as long as start
- points to the first valid pixel, and xskip is set to the total row-wastage.
-
- SWI GreyEdit_Map
- ----------------
- Maps the image's pixel values.
-
- On entry - r0 points to image info block (start/xpix/ypix/xskip)
- - r1 points to 256-entry pixel value map
-
- I.e. for all pixels, new_pixel_value = r1?old_pixel_value
-
- SWI GreyEdit_Cut
- ----------------
- Cuts down an image.
-
- On entry - r0 points to image info block (start/xpix/ypix/xskip)
- - r1 points to cut info block (start/left/top/right/bottom/xskip)
-
- The word-values in the cut info block determine the new (smaller) size and
- structure of the image. The new image is a sub-image of the old image, and is
- defined by the coordinates of its top left corner and its bottom right corner
- within the old image. It is stored at the address contained in the start value
- of the cut info block.
-
- The xskip given in the cut info block is the xskip value of the new image. The
- skipped pixels in the new image are all set to 0. The left value may range from
- 0 to xpix-1, the right value from left to xpix-1, the top value from 0 to
- ypix-1, and the bottom value from top to ypix-1.
-
- The cut info is not checked in any way, so it is your responsibility to supply
- sensible values.
-
- The x/y size of the new image will obviously be right-left-1/bottom-top-1.
-
- SWI GreyEdit_Filter
- -------------------
- Applies a filter algorithm to an image. For details on the algorithms refer to
- 'Technical details' in Docs.Guide.
-
- On entry - r0 points to image info block (start/xpix/ypix/xskip)
- - r1 indicates the filter to be applied
- 1 - Noise (soft)
- 2 - Noise (strong)
- 3 - Gauss
- 4 - Average
- 5 - Laplace
- 6 - X-gradient Sobel
- 7 - Y-gradient Sobel
- 8 - Maximum
- 9 - Minimum
- 10 - Sharpen (soft)
- 11 - Sharpen (strong)
- 12 - Lee
-
- SWI GreyEdit_Frequency
- ----------------------
- Calculates the frequencies of greyvalues in an image.
-
- On entry - r0 points to image info block (start/xpix/ypix/xskip)
- On exit - r0 points to frequency table (4-byte counters)
-
- I.e. the number of occurences of greyvalue g is r0!(g<<2).
-
- SWI GreyEdit_Equalize
- ---------------------
- Applies the histogram equalization algorithm to an image.
-
- On entry - r0 points to image info block (start/xpix/ypix/xskip)
- On exit - r0 points to cumulative histogram table (4-byte counters)
- - r1 points to equalization greyvalue map
-
- To equalize the image, this SWI should be followed by GreyEdit_Map, using the
- map returned at r1. The g'th entry in the cumulative histogram table represents
- the added frequencies of the greyvales from 0-g, i.e. the 255th entry is always
- equal to the total number of pixels in the image, xpix*ypix.
-
- SWI GreyEdit_Pattern
- --------------------
- Fills the current image with a pattern.
-
- On entry - r0 points to image info block (start/xpix/ypix/xskip)
- - r1 contains pattern code
- 0 - clear (i.e. black, all greyvalues set to 0)
- 1 - 'blinds' pattern
- 2 - 'blinds' pattern (rotated)
-
-
- - The digitiser SWI's
-
- These SWI's all drive the Zeridajh Video Digitiser podule. When it is not
- present (see GreyEdit_CheckDigi), they should not be called.
-
- SWI GreyEdit_CheckDigi
- ----------------------
- Checks presence of the Zeridajh Video Digitiser podule, and initialises usage
- of the other digitiser SWI's if it is. Thus, it should always be the first SWI
- called.
-
- On entry - r0 contains podule's ID code
- On exit - r0 contains podule's base address if it is present, else 0
-
- SWI GreyEdit_Grab
- -----------------
- Digitises a video image.
-
- On entry - r0 points to image data buffer
- - r1 contains size of image data buffer
- - r2 contains required horizontal resolution in pixels
- - r3 contains required vertical resolution in pixels
- - r4<>0 gives 'line skip' (scanlines skipped at top of video image),
- else default of 20 is taken (approx. center of video image)
- - r5<>0 gives lowest delay factor, else default of 200 is taken.
- DO NOT CHANGE, I.E. USE 0.
- - r6 contains flags
- bit 0 - when set (1) prevents video DMA disable when grabbing
- bit 1 - when set (1) prevents re-enable of video DMA on ok exit
- On exit - r0 points to error block (V set) if error occured
-
- This SWI digitizes a video image, storing it in the supplied image data buffer.
- The range of available resolutions is restricted to 5*xfac/1*yfac for x/y
- respectively, where xfac/yfac is a power of 2, up to 640x512. When r2/r3 lies
- outside this range, the value is rounded up to the nearest available value.
- I.e. 160x128 is a valid resolution, but 161x128 would be rounded up to 320x128.
-
- When the image buffer is too small to contain the image, an error is returned.
-
- The value of r4 determines the number of scanlines that are skipped at the top
- of the video image. When a value of 0 is given, the default of 20 is taken,
- which skips approximately the same number of lines at the top and bottom of the
- video image (i.e. the 'center' is taken).
-
- The value of r5 should always be 0. The delay factor plays an important role in
- the digitizing process, so it should not be tampered with. It is only present
- for (future) development purposes.
-
- Video DMA is usually disabled when grabbing, and re-enabled on exit. Both of
- these 'effects' can be switched off by setting the appropiate bits in r6.
- Setting bit 0 may cause the image to be distorted, when the processing delays
- introduced by video DMA prevents the software to keep its synchronization with
- the video image.
-
- SWI GreyEdit_VideoDMA
- ---------------------
- Turns video DMA on/off.
-
- On entry - r0 contains 0 to turn video DMA off, or 1 to turn it on.
-
- SWI GreyEdit_VideoTiming
- ------------------------
- Returns a number of values representing the vsync and hsync signals present in
- the video image. Also returns a rough classification of the video signal based
- on the vsync and hsync signals.
-
- The values are returned in a signal buffer. They are bit values (0/1), which
- represent the exclusive OR of (NOT Burst,Vsync) from the LM1881 on the podule.
- The bit-values are packed 8 at a time in bytes (bit 0 first). The entire buffer
- is filled. Video DMA is disabled temporarily.
-
- On entry - r0 points to signal buffer
- - r1 contains length of signal buffer in bytes
- On exit - r2 gives a video signal type code
- -1 = no video signal detected
- 0 = normal video signal
- 1 = MacroVision protected video tape signal
-
- SWI GreyEdit_Sensitivity
- ------------------------
- May be used to set the podule's video signal sensitivity, when the
- software-controlled sensitivity extension has been added to the podule.
-
- Ask your dealer for details.
-
- On entry - r0 contains sensitivity value and flags
- bit 0-7 : sensitivity value
- bit 8 : if set (1) value is percentage (0(low)-100(high))
- if clear (0) value is 0(high)-255(low)
- On exit - r0 contains -1 if the PCF8591 (i.e. the extension) is not present,
- else 0
-
- Where 'low' is lowest sensitivity ('dark' images), and 'high' highest
- sensitivity ('light' images).
-
- SWI GreyEdit_Switch
- -------------------
- Selects one of four independant video inputs when the colour extension has been
- added to the podule.
-
- Ask your dealer for details.
-
- On entry - r0 contains switch code
- 0 - switch to b/w input (luminance or composite video)
- 1 - switch to Red input
- 2 - switch to Green input
- 3 - switch to Blue input
- On exit - r0 contains -1 if the PCF8574 (i.e. the extension) is not present,
- else 0
-
-